package net.aiion.weave.impl.bytecode.events;

import net.aiion.weave.asm.Label;
import net.aiion.weave.spi.bytecode.BytecodeVisitor;
import net.aiion.weave.spi.bytecode.events.LookupSwitchInstructionBytecodeEvent;

public class LookupSwitchInstructionBytecodeEventImpl extends BytecodeEventImpl implements
    LookupSwitchInstructionBytecodeEvent
{
    private Label defaultLabel;
    private int[] keys;
    private Label[] blockLabels;

    public LookupSwitchInstructionBytecodeEventImpl(final Label aDefaultLabel, final int[] aKeys,
        final Label[] aBlockLabels)
    {
        defaultLabel = aDefaultLabel;
        keys = aKeys;
    }

    @Override
    public int getType() {
        return LOOKUP_SWITCH_INSTRUCTION;
    }

    @Override
    public void setDefaultLabel(final Label aDefaultLabel) {
        defaultLabel = aDefaultLabel;
    }

    @Override
    public Label getDefaultLabel() {
        return defaultLabel;
    }

    @Override
    public void setKeys(final int[] aKeys) {
        keys = aKeys;
    }

    @Override
    public int[] getKeys() {
        return keys;
    }

    @Override
    public void setBlockLabels(final Label[] aBlockLabels) {
        blockLabels = aBlockLabels;
    }

    @Override
    public Label[] getBlockLabels() {
        return blockLabels;
    }

    @Override
    public BytecodeVisitor acceptBytecodeVisitor(final BytecodeVisitor aBytecodeVisitor) {
        aBytecodeVisitor.asBytecodeMethodVisitor().visitLookupSwitchInstruction(this);
        return aBytecodeVisitor;
    }
}
